<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>权限矩阵文档管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="{{ url_for('dms.static', filename='layuiadmin/layui/css/layui.css') }}">
    <link rel="stylesheet" href="{{ url_for('dms.static', filename='layuiadmin/style/admin.css') }}">
    <link rel="stylesheet" href="{{ url_for('dms.static', filename='layui/layui-icon-extend/iconfont.css') }}">
    <style>
        .copy-link {
            cursor: pointer;
            color: blue;
        {#text-decoration: underline;#}
        }
    </style>
</head>
<body class="layui-layout-body">

<div id="LAY_app">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <!-- 头部区域 -->
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item layadmin-flexible" lay-unselect>
                    <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
                        <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
                    </a>
                </li>

                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;" layadmin-event="refresh" title="刷新">
                        <i class="layui-icon layui-icon-refresh-3"></i>
                    </a>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="javascript:;" layadmin-event="theme">
                        <i class="layui-icon layui-icon-theme"></i>
                    </a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="javascript:;" layadmin-event="note">
                        <i class="layui-icon layui-icon-note"></i>
                    </a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="javascript:;" layadmin-event="fullscreen">
                        <i class="layui-icon layui-icon-screen-full"></i>
                    </a>
                </li>
                <li class="layui-nav-item ">
                    <a id="copyTarget" class="copy-link">{{ user_name }}[{{ ip }},{{ user_type }}]</a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="javascript:;" layadmin-event="about"><i
                            class="layui-icon layui-icon-more-vertical"></i></a>
                </li>
                <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect>
                    <a href="javascript:;" layadmin-event="more"><i class="layui-icon layui-icon-more-vertical"></i></a>
                </li>
            </ul>
        </div>

        <!-- 侧边菜单 -->
        <div class="layui-side layui-side-menu">
            <div class="layui-side-scroll">
                <div class="layui-logo" lay-href="/dms/console">
                    <span>权限矩阵文档管理系统</span>
                </div>

                <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu"
                    lay-filter="layadmin-system-side-menu">
                    <li data-name="home" class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;" lay-tips="主页" lay-direction="2">
                            <i class="layui-icon layui-icon-home"></i>
                            <cite>主页</cite>
                        </a>
                        <dl class="layui-nav-child">
                            <dd data-name="console" class="layui-this">
                                <a lay-href="/dms/console">
                                    <i class="layui-icon iconfont layui-extend-summary"></i>
                                    <cite>总览</cite>
                                </a>
                            </dd>
                        </dl>
                    </li>
                    <li data-name="app" class="layui-nav-item layui-nav-itemed">
                        <a lay-href="/dms/oneClickExport" lay-tips="一键导出" lay-direction="2">
                            <i class="layui-icon iconfont layui-extend-export"></i>
                            <cite>一键导出</cite>
                        </a>
                    </li>
                    <li data-name="app" class="layui-nav-item layui-nav-itemed">
                        <a lay-href="/dms/log" lay-tips="日志查询" lay-direction="2">
                            <i class="layui-icon iconfont layui-extend-rizhichaxun"></i>
                            <cite>日志查询</cite>
                        </a>
                    </li>
                    <li data-name="app" class="layui-nav-item layui-nav-itemed">
                        <a lay-href="/dms/message/" lay-tips="国际化" lay-direction="2">
                            <i class="layui-icon iconfont layui-extend-guojihua"></i>
                            <cite>国际化</cite>
                        </a>
                    </li>
                    <li data-name="app" class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;" lay-tips="Lookup" lay-direction="2">
                            <i class="layui-icon iconfont layui-extend-lookup"></i>
                            <cite>Lookup</cite>
                        </a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a lay-href="/dms/lookupExportAll">Lookup整体导出</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/lookupClassify">Lookup Classify</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/lookupItem">Lookup Item</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/lookupDelete">Lookup手工删除</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/lookupDisable">Lookup手工失效</a>
                            </dd>
                        </dl>
                    </li>

                    <li data-name="app" class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;" lay-tips="菜单" lay-direction="2">
                            <i class="layui-icon iconfont layui-extend-caidan"></i>
                            <cite>菜单</cite>
                        </a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a lay-href="/dms/catalogExportAll">菜单整体导出</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/catalog">菜单</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/catalogModify">菜单修改</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/catalogDelete">菜单删除</a>
                            </dd>
                        </dl>
                    </li>

                    <li data-name="app" class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;" lay-tips="权限集" lay-direction="2">
                            <i class="layui-icon iconfont layui-extend-quanxianji"></i>
                            <cite>权限集</cite>
                        </a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a lay-href="/dms/functionExportAll">权限集整体导出</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/function/">权限集</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/functionPermission">权限集权限点</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/functionCatalog">权限集菜单</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/functionDimension">权限集维度</a>
                            </dd>
                        </dl>
                    </li>

                    <li data-name="app" class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;" lay-tips="角色" lay-direction="2">
                            <i class="layui-icon iconfont layui-extend-jiaoseguanli"></i>
                            <cite>角色</cite>
                        </a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a lay-href="/dms/roleExportAll">角色整体导出</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/role">角色</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/roleFunction">角色权限集</a>
                            </dd>
                            <dd>
                                <a lay-href="/dms/roleFunctionDelete">取消角色权限集</a>
                            </dd>
                        </dl>
                    </li>

                    <li data-name="app" class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;" lay-tips="数据字典" lay-direction="2">
                            <i class="layui-icon iconfont layui-extend-shujuzidian"></i>
                            <cite>数据字典</cite>
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a lay-href="/dms/propertyPlan/">字典-计划</a></dd>
                            <dd><a lay-href="/dms/propertyIns/">字典-指令</a></dd>
                            <dd><a lay-href="/dms/propertyCommon/">字典-公共</a></dd>
                            <dd><a lay-href="/dms/propertyMonitor/">字典-监控</a></dd>
                            <dd><a lay-href="/dms/propertyEod/">字典-eod</a></dd>
                            <dd><a lay-href="/dms/propertyDataPlan/">字典-接入层</a></dd>
                            <dd><a lay-href="/dms/propertyMonitorHis/">字典-mon his</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

        <!-- 页面标签 -->
        <div class="layadmin-pagetabs" id="LAY_app_tabs">
            <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
            <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
            <div class="layui-icon layadmin-tabs-control layui-icon-down">
                <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
                    <li class="layui-nav-item" lay-unselect>
                        <a href="javascript:;"></a>
                        <dl class="layui-nav-child layui-anim-fadein">
                            <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
                            <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
                            <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
            <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
                <ul class="layui-tab-title" id="LAY_app_tabsheader">
                    <li lay-id="/dms/console" lay-attr="/dms/console" class="layui-this"><i
                            class="layui-icon iconfont layui-extend-summary"></i></li>
                </ul>
            </div>
        </div>

        <!-- 主体内容 -->
        <div class="layui-body" id="LAY_app_body">
            <div class="layadmin-tabsbody-item layui-show">
                <iframe src="/dms/console" frameborder="0" class="layadmin-iframe"></iframe>

            </div>
        </div>

        <!-- 辅助元素，一般用于移动设备下遮罩 -->
        <div class="layadmin-body-shade" layadmin-event="shade"></div>
    </div>
</div>

<script src="{{ url_for('dms.static', filename='layuiadmin/layui/layui.js') }}"></script>

<script>
    layui.config({
        // base: '../layuiadmin/' //静态资源所在路径
        base: "{{ url_for('dms.static', filename='layuiadmin/') }}" //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');

    // 复制用户信息
    document.getElementById('copyTarget').addEventListener('click', async () => {
        const textToCopy = document.getElementById('copyTarget').textContent;
        console.log("textToCopy=" + textToCopy);
        const success = await copyToClipboard(textToCopy);
        if (success) {
            // 显示成功提示
            layer.msg('复制成功！');
        } else {
            console.error('复制失败:', err);
            layer.msg('复制失败，请手动复制代码');
            {#alert('复制失败，请手动复制代码');#}
        }
    });

    // 复制函数，传入需要复制的文本，即可复制到剪贴板
    function copyToClipboard(text) {
        // 方案1：优先尝试现代 Clipboard API
        if (navigator.clipboard && navigator.clipboard.writeText) {
            return navigator.clipboard.writeText(text)
                .then(() => true)
                .catch(error => {
                    console.error("Clipboard API failed:", error);
                    return false; // 继续尝试降级方案
                });
        }
        // 方案2：降级到 document.execCommand('copy')
        if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
            return new Promise((resolve) => {
                // 创建临时文本域
                const textarea = document.createElement('textarea');
                textarea.value = text;
                textarea.style.position = 'fixed'; // 防止页面滚动
                textarea.style.opacity = '0';      // 不可见但可操作
                document.body.appendChild(textarea);
                textarea.select();
                try {
                    const success = document.execCommand('copy');
                    resolve(success);
                } catch (error) {
                    console.error("execCommand failed:", error);
                    resolve(false);
                } finally {
                    document.body.removeChild(textarea);
                }
            });
        }
        // 方案3：终极降级方案（兼容移动端）
        return new Promise((resolve) => {
            try {
                // 创建可选择的临时元素
                const div = document.createElement('div');
                div.contentEditable = true;
                div.style.position = 'fixed';
                div.style.opacity = '0';
                div.textContent = text;
                document.body.appendChild(div);
                // iOS 兼容处理
                const range = document.createRange();
                range.selectNodeContents(div);
                const selection = window.getSelection();
                selection.removeAllRanges();
                selection.addRange(range);
                div.contentEditable = true;
                // 执行复制
                document.execCommand('copy');
                resolve(true);
            } catch (error) {
                console.error("Fallback copy failed:", error);
                resolve(false);
            } finally {
                document.body.removeChild(div);
            }
        });
    }

</script>

</body>
</html>


